package com.hy.study.utils;

import lombok.Data;

/**
 * @author huyong
 * @date 2024 年 01 月 05 日 17:46: 04
 */
@Data
public class Result<T> {

    private int code;
    private String message;
    private T data;

    public Result(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Result(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public Result() {
        this.code = StatusCode.OK;
        this.message = "执行成功";
    }

    public Result(T data) {
        this.code = StatusCode.OK;
        this.message = "执行成功";
        this.data = data;
    }
}
